import { pubRequire } from '@utils/public'
const baseUrl = '/integrals/strategies'
// 积分策略列表
export function getList(params, callBack, errBack) {
  return pubRequire('get', `${baseUrl}`, params, callBack, errBack)
}
// 积分策略明细列表
export function getDetailList(taskId, params, callBack, errBack) {
  return pubRequire(
    'get',
    `${baseUrl}/${taskId}/users`,
    params,
    callBack,
    errBack
  )
}
// 根据ID查询积分策略任务详情
export function getFormDetail(taskId, callBack, errBack) {
  return pubRequire('get', `${baseUrl}/${taskId}`, '', callBack, errBack)
}
// 修改积分策略
export function editStrategy(taskId, params, callBack, errBack) {
  return pubRequire('put', `${baseUrl}/${taskId}`, params, callBack, errBack)
}
// 积分策略状态停用
export function stopStrategy(taskId, callBack, errBack) {
  return pubRequire(
    'put',
    `${baseUrl}/${taskId}/disabled`,
    '',
    callBack,
    errBack
  )
}
// 积分策略状态启用
export function openStrategy(taskId, callBack, errBack) {
  return pubRequire('put', `${baseUrl}/${taskId}/enable`, '', callBack, errBack)
}
